package com.demo.spring;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Dialogue {
    private String zhuge = null;
    private String lufei = null;

    public void print(){
        System.out.println("路飞：" + this.getLufei());
    }

    public void prant(){
        System.out.println("猪哥亮：" + this.getZhuge() + "!");
    }

    public String getZhuge() {
        return zhuge;
    }

    public void setZhuge(String zhuge) {
        this.zhuge = zhuge;
    }

    public String getLufei() {
        return lufei;
    }

    public void setLufei(String lufei) {
        this.lufei = lufei;
    }

    @Test
    public void testDialogue(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Dialogue dialogue = (Dialogue) context.getBean("Dialogue");
        dialogue.print();
        dialogue.prant();
    }
}
